home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 4 / The 640 Meg Shareware Studio CD-ROM Volume IV (Data Express)(1994).ISO / clang / xlib05.zip / XLIB.H < prev    next >
C/C++ Source or Header  |  1993-08-25  |  6KB  |  150 lines

  1. /*----------------------------------------------------------------------
  2. ;
  3. ; XLIB - header file
  4. ;
  5. ;
  6. ;
  7. ; ****** XLIB - Mode X graphics library                ****************
  8. ; ******                                               ****************
  9. ; ****** Written By Themie Gouthas                     ****************
  10. ;
  11. ; egg@dstos3.dsto.gov.au
  12. ; teg@bart.dsto.gov.au
  13. ;
  14. ; Header file contributed by Darren Lyon (darren@nicky.DIALix.oz.au)
  15. ;
  16. ;
  17. ;  Terminology & notes:
  18. ;         VRAM ==   Video RAM
  19. ;         SRAM ==   System RAM
  20. ;         X coordinates are in pixels unless explicitly stated
  21. ;
  22. ;----------------------------------------------------------------------*/
  23.  
  24. #ifndef _XLIB_H_
  25. #define _XLIB_H_
  26.  
  27. #define BYTE unsigned char
  28. #define WORD unsigned int
  29.  
  30.  
  31. #define X_MODE_320x200  0
  32. #define X_MODE_320x240  1
  33. #define X_MODE_360x200  2
  34. #define X_MODE_360x240  3
  35. #define X_MODE_376x282  4
  36. #define X_MODE_320x400  5
  37. #define X_MODE_320x480  6
  38. #define X_MODE_360x400  7
  39. #define X_MODE_360x480  8
  40. #define X_MODE_360x360  9
  41. #define X_MODE_376x308  10
  42. #define X_MODE_376x564  11
  43. #define X_MODE_256x400  12
  44. #define X_MODE_256x480  13
  45.  
  46.  
  47. #define BACKWARD 0
  48. #define FORWARD  1
  49.  
  50. #define X_MODE_INVALID  -1
  51. #define ERROR            1
  52. #define OK               0
  53.  
  54. /* FUNCTIONS =========================================================== */
  55.  
  56. #ifdef __cplusplus
  57. extern "C" {
  58. #endif
  59.  
  60.  WORD x_set_mode(
  61.         WORD mode,                /* Initialize x mode           */
  62.         WORD WidthInPixels);
  63.  
  64.   void x_select_default_plane( /*Enables Read/Write access to a    */
  65.                 BYTE plane);   /* a specified plane                */
  66.  
  67.  void x_set_splitscreen(            /* set the split screen start  */
  68.         WORD line);         /*scan line (initialize)       */
  69.  
  70.  void x_set_start_addr(
  71.         WORD X,             /* Set the screen start        */
  72.         WORD Y);            /* address in video ram        */
  73.  
  74.  void x_hide_splitscreen(void); /* Disable the split screen (Split */
  75.                                 /* Screen RAM remains reserved)    */
  76.  
  77.  void x_show_splitscreen(void); /* Enable the split screen (given it */
  78.                                 /* was previously "hidden")          */
  79.  
  80.  
  81.  void x_adjust_splitscreen(   /* Adjust the start scan line of the */
  82.                 WORD line);   /* split screen                      */
  83.  
  84.  
  85.  WORD x_set_doublebuffer(         /* Enable double buffering with a    */
  86.                 WORD PageHeight); /* specified page height             */
  87.  
  88.  
  89.  void x_page_flip(        /* Swap visible page (only when double   */
  90.                 WORD X,   /* buffering is active) & sets virt start*/
  91.                 WORD Y);
  92.  
  93.  void x_set_cliprect(      /* Define the clipping rectangle */
  94.                 WORD left, /* NOTE: left and right are in bytes */
  95.                 WORD top,
  96.                 WORD righ,
  97.                 WORD bottom);
  98.  
  99.  void x_text_mode(void);   /* return to text mode */
  100.  void x_wait_vsync(void);  /* wait for vsync */
  101.  
  102. #ifdef __cplusplus
  103. }
  104. #endif
  105.  
  106.  
  107. /* VARIABLES =========================================================== */
  108.  
  109. extern BYTE InGraphics;             /* non zero if in X graphics mode      */
  110. extern WORD CurrXMode;              /* contains current X graphics mode id */
  111. extern WORD ScrnPhysicalByteWidth;  /* Physical screen width in bytes      */
  112. extern WORD ScrnPhysicalPixelWidth; /* Physical screen width in pixels     */
  113. extern WORD ScrnPhysicalHeight;     /* Physical screen height in pixels    */
  114. extern WORD ErrorValue;             /* Error return value                  */
  115. extern WORD SplitScrnOffs;          /* Offset in VRAM  of split screen     */
  116. extern WORD SplitScrnScanLine;      /* Scan line split screen starts at    */
  117.                     /* initially. Resizing the split scrn  */
  118.                     /* using the other functions does not  */
  119.                     /* change this value                   */
  120. extern WORD SplitScrnVisibleHeight; /* Height of the visible portion of the*/
  121.                     /* split screen.                       */
  122. extern WORD Page0_Offs;             /* Offset in VRAM of main virt. screen */
  123. extern WORD Page1_Offs;             /* Offset in VRAM of 2nd virt. screen  */
  124. extern WORD ScrnLogicalByteWidth;   /* Virtual screen width in bytes       */
  125. extern WORD ScrnLogicalPixelWidth;  /* Virtual screen width in pixels      */
  126. extern WORD ScrnLogicalHeight;      /* Virtual screen height in pixels     */
  127. extern WORD MaxScrollX;             /* Max X position of physical screen   */
  128.                                     /*  within virtual screen              */
  129. extern WORD MaxScrollY;             /* Max Y position of physical screen   */
  130.                                     /*  within virtual screen              */
  131. extern WORD DoubleBufferActive;     /* Indicates whether double buffering  */
  132.                                     /* is active                           */
  133. extern WORD VisiblePageIdx;         /* Index number of visible page 0 or 1 */
  134. extern WORD HiddenPageOffs;         /* Offset of Hidden Pg | only valid    */
  135. extern WORD VisiblePageOffs;        /* Offset of Visible Pg| for D.B. mode */
  136. extern WORD NonVisual_Offs;         /* Offset of first non-visible VRAM    */
  137.  
  138. extern WORD TopClip;                /* Clipping rectangle                  */
  139. extern WORD BottomClip;
  140. extern WORD LeftClip;
  141. extern WORD RightClip;
  142.  
  143. extern WORD PhysicalStartPixelX;    /* Coordinates of physical (visible) */
  144. extern WORD PhysicalStartByteX;     /* screen relative to the virtual    */
  145. extern WORD PhysicalStartY;         /* screen's U.L. corner              */
  146.  
  147. #endif
  148.  
  149.  
  150.